use std::cmp::PartialOrd;
fn largest<T: PartialOrd + Copy>(list: &Vec<T>) -> T {
    let mut largest = list[0];
    for &item in list.iter() {
        if item > largest {
            largest = item;
        }
    }
    largest
}
//结构体
struct PointA<T> {
    x: T,
    y: T,
}
#[derive(Debug)]
struct Point<T, U> {
    x: T,
    y: U,
}
impl<T, U> Point<T, U> {
    fn mixup<V, W>(self, other: Point<V, W>) -> Point<T, W> {
        Point {
            x: self.x,
            y: other.y,
        }
    }
}
fn main() {
    let number_list = vec![34, 50, 25, 100, 65];

    let result = largest(&number_list);
    println!("result{}", result);
    let _integer = PointA { x: 5, y: 10 };
    let _float = PointA { x: 5.0, y: 10.0 };
    _float.x;
    _float.y;
    let _val = Point { x: 5, y: 10.0 };
    let _p2 = Point { x: "Hello", y: 'c' };
    let _res = _val.mixup(_p2);
    println!("res:{:?}", _res);
}
